package session

import "qiniupkg.com/x/errors.v7"

var errorSessionNotExist = errors.New("session not exist")

type StudentSession struct {
	global     *GlobalStudentSession
	aiCourse   *StudentAIHashSession
	examCourse *StudentExamHashSession
}

func (ss *StudentSession) GetStudentGlobalSession() (*GlobalStudentSession, error) {
	if ss.global == nil {
		return nil, errorSessionNotExist
	}
	return ss.global, nil
}

func (ss *StudentSession) GetStudentAiSession() (*StudentAIHashSession, error) {
	if ss.aiCourse == nil {
		return nil, errorSessionNotExist
	}
	return ss.aiCourse, nil
}

func (ss *StudentSession) GetStudentExamSession() (*StudentExamHashSession, error) {
	if ss.examCourse == nil {
		return nil, errorSessionNotExist
	}
	return ss.examCourse, nil
}

type TeacherSession struct {
	Global     *GlobalTeacherSession
	AiCourse   *TeacherAiHashSession
	ExamCourse *TeacherExamHashSession
}
